class Person {
    constructor(
        protected name,
        protected age
    ) {}

    protected getDetail() {
        return `我的名字是${this.name},我的年龄是${this.age}`
    }

    say() {
        return this.getDetail()
    }
}

const p1 = new Person('tom', 20)
p1.name
p1.age
p1.getDetail()
p1.say()